feat(runner): the authed share round-trip, against the real backend (DEV-2203) - #186
Merged
Conversation
…DEV-2203) create → build → view → revoke, no stubs: the one test that exercises the builder, R2 and D1 end to end. Everything else about sharing is proved with stubbed APIs (authed-actions) or read-only against a fixture (share-view); nothing walked the write path a deploy could break. Gated on E2E_BROKER_TOKEN — the worker re-validates every bearer against the broker and requires @handsontable.com, deliberately, so the token is a secret someone refreshes by hand when they want the run. The spec asserts the signed-in top bar before acting, so an expired token reads as 'token expired', not a dead Share button. One BuilderSandbox boot and one D1 row per run; the revoke in finally is both the cleanup and the last assertion (a revoked share answers 410).
added 2 commits
August 17, 2026 08:34
…#186) getByLabel(/client link/i) matched both the field and its 'Copy Public client link' button; strict mode threw before demoId was set, so the finally never revoked and the minted production share stayed live. The id now comes from the POST /api/demos response the moment it exists — no locator can stand between the mint and the cleanup — and the dialog read narrows to the textbox role, asserting it names the same demo.
danielzytohoc
changed the base branch from
feat/DEV-2203-engine-and-docs-frameworks
to
feat/DEV-2203-style-panel-e2e
August 17, 2026 06:35
A visible Fork button proves auth, not content: the workspace starts as an empty placeholder and fills asynchronously — and can refill when /api/versions swaps in latest. Sharing in that window posts empty files and burns the whole 300s dialog budget on a doomed build. The test now waits for /package.json to exist in the files map first.
added 2 commits
August 18, 2026 10:16
demtario
approved these changes
Aug 18, 2026
added 3 commits
August 18, 2026 17:30
added 2 commits
August 19, 2026 09:57
…eadroom (Bugbot #186) test.setTimeout(420s) equalled the sum of the wait ceilings exactly (30+30+300+60), so a build that used its whole dialog budget timed the body out before the view assertions — and a timed-out body is killed mid-flight, finally included, leaving the minted production share alive. The revoke (and its 410 assertion) moves to an afterEach with its own 60s timeout slice, which runs even when the body dies; the body budget rises to 480s. No sleeps anywhere — every wait stays condition-bound with a ceiling.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1af1719. Configure here.
danielzytohoc
pushed a commit
that referenced
this pull request
Aug 19, 2026
The wire capture is un-awaited and its json read best-effort — if it lost the race, a demo existed (the dialog was showing its link) while afterEach saw null and skipped the revoke. The dialog link's id is now the recovery path: demoId ??= linkId before any assertion can throw, and the two sources are asserted to agree when both answered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Sixth in the DEV-2203 series. Stacked on #184.
What
e2e/share-create-live.spec.ts— one test, the full authed write path with no stubs: real broker token → Share → realPOST /api/demos(BuilderSandbox build, 300 s budget) →/d/:id/renders for an anonymous client →DELETEinfinally→ 410. The revoke is both cleanup and the final assertion, and rows are soft-deleted, so the worst-case leak is one revoked row.Gate:
E2E_BASE_URLandE2E_BROKER_TOKEN(a freshsessionStorage.hot_tokenfrom a signed-in session — documented in AGENTS.md). Broker tokens expire and cannot be minted programmatically; the sustainable machine-auth story is a follow-up ticket, and until then this runs on demand from the e2e-live dispatch, never on a schedule.Verification
Skip behavior verified (skips without the env pair; asserts the signed-in top bar before acting so an expired token reads as "token expired"). The live path needs a real token — @dan: one manual run with your session token before wiring it into e2e-live would be the proof.
Cost: one BuilderSandbox boot (pool of 3) + one D1 row per run.
Note
Low Risk
Changes are mostly E2E and documented test hooks; production impact is limited to
__HOT_FILES__andaria-labelon Style panel rows. The live share spec only runs with secrets and revokes demos inafterEach.Overview
Live authed share path —
e2e/share-create-live.spec.tsruns create → realPOST /api/demosbuild → anonymous/d/:id/→ revoke/410 against a deployed worker, gated onE2E_BASE_URLandE2E_BROKER_TOKEN. Revoke runs inafterEach(not the testfinally) so timeouts don’t leave minted shares; demo id is captured from the POST response; the suite waits for starter workspace files before sharing and bumps the test timeout so build/dialog waits can finish.Style panel E2E —
e2e/style-panel.spec.tscovers panel UI,localStoragetheme state, codegen output, linked tokens, density variants, themeName round-trip on a docs fixture, reload persistence, “Copy for my app”, unrecognized grid shapes, and Google Fonts — deterministic (stubbed shell, no live bundler) for PR CI.Test contracts —
App.tsxexposeswindow.__HOT_FILES__()(sync withfilesRef, including quiet Style writes) so specs don’t read virtualized CodeMirror.StylePanel.tsxaddsaria-label={section.label}on component rows so role queries stay stable when override badges change names.Docs —
AGENTS.mddocumentsE2E_BROKER_TOKENfor the share live spec andE2E_AI=1for live LLM checks.Reviewed by Cursor Bugbot for commit 1af1719. Bugbot is set up for automated code reviews on this repo. Configure here.